public class Thing implements Cloneable{
    public String name;
    public Money money = new Money();

    public Thing(String name) {
        this.name = name;
    }

    @Override
    protected Object clone()
            throws CloneNotSupportedException {
//        return super.clone();
        Thing tem = (Thing)super.clone();
        tem.money=(Money)this.money.clone();
        return tem;
    }

    @Override
    public String toString() {
        return "Thing{" +
                "name='" + name + '\'' +
                '}';
    }
}

class Money implements Cloneable{
    public double value=9.9;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}